<script>
    window.onload=function(){
        var a = $("table").width(),//width()返回元素的宽高，不包括padding/border/margin
            b = $("table").innerWidth(),//innerWidth()返回元素的宽高 + padding
            c = $("table").outerWidth(),//outerWidth()返回元素的宽高 + padding + border
            d = $("table").outerWidth(true);//outerWidth(true)返回元素宽高 + padding + border + margin
        var ac = $('#add-form').width();
        console.log(ac-70)
        console.log(a)
        if(ac -70 < a && ac < 1275){
            $('#table').attr('style','display: block;overflow:auto;')
            $('#table1').attr('style','display: block;overflow:auto;')
        }else{
            $('#table').attr('style','')
            $('#table1').attr('style','')
        }
    }
    window.onresize = function(){
        console.log(2)
        var a = $("table").width(); //width()返回元素的宽高，不包括padding/border/margin
        var ac = $('#add-form').width();
        if(ac-70 < a){
            $('#table').attr('style','display: block;overflow:auto;')
            $('#table1').attr('style','display: block;overflow:auto;')
        }else{
            $('#table').attr('style','')
            $('#table1').attr('style','')
        }
    }
</script>